package com.opcode.nebulamobil.utility;

import java.lang.reflect.Constructor;


/**
 * Class tipinden o class tipine ait nesne d�nd�rmek i�in kullan�l�r.
 * @author Okan ERDO�AN
 *
 * 26 Tem 2014
 */
public class ObjectCreator {

	
	/**
	 * Parametre olarak class al�r ve geriye o class'a ait nesneyi d�nd�r�r.
	 * @param cls
	 * @return
	 */
	public static Object createClass(Class<?> cls) {
		try{
			Class<?> param[] = new Class[1];		
			Constructor<?> ct = cls.getConstructor();		
			Object retobj = ct.newInstance();
			return retobj;
		}
		catch(Exception ex){
			STSLog.writeLog(ex,"com.opcode.components.utilities.ObjectCreator","Class'tan obje olu�turma esnas�nda hata meydana geldi.Geriye null d�nderildi.");														
			return null;
		}
	}
}
